// 报销申请流程列表
var afrColumns = [{
  id: 'afrNo',
  title: '报销单号',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'afrType',
  title: '报销类别',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'afrPmony',
  title: '发票总数目',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'afrPrice',
  title: '报销总金额',
  type: 'string',
  width: 150,
  columnClass: 'text-center',
}, {
  id: 'afrMsg',
  title: '申请说明',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'afrName',
  title: '申请人',
  type: 'string',
  width: 80,
  columnClass: 'text-center',
},{
  id: 'afrTime',
  title: '申请时间',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
},{
  id: 'operation',
  title: '操作',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-success" onclick="toDo(' + record.id + ',' + record.doType + ');"><i class="fa fa-edit"></i>  查看办理</button>';
    return content;
  }
}];
var afrOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '报销申请流程列表',
  datas: [{
    id: 1,
    afrNo: 'NJ20180101182988',
    afrType: '出差报销',
    afrPmony: '12张',
    afrPrice: '￥9999999.00元',
    afrMsg: '出差报销申请已提交，关联项目负责人审批',
    afrName: '张三测试',
    afrTime: '2018-01-01',
    doType: 53,
  },{
    id: 2,
    afrNo: 'NJ20180101182988',
    afrType: '出差报销',
    afrPmony: '12张',
    afrPrice: '￥9999999.00元',
    afrMsg: '出差报销申请已提交，关联项目负责人审批：被退回',
    afrName: '张三测试',
    afrTime: '2018-01-01',
    doType: 54,
  },{
    id: 3,
    afrNo: 'NJ20180101182988',
    afrType: '出差报销',
    afrPmony: '12张',
    afrPrice: '￥9999999.00元',
    afrMsg: '项目归属部门总监审批',
    afrName: '张三测试',
    afrTime: '2018-01-01',
    doType: 53,
  },{
    id: 4,
    afrNo: 'NJ20180101182988',
    afrType: '出差报销',
    afrPmony: '12张',
    afrPrice: '￥9999999.00元',
    afrMsg: '项目归属部门总监审批：被退回',
    afrName: '张三测试',
    afrTime: '2018-01-01',
    doType: 54,
  },{
    id: 5,
    afrNo: 'NJ20180101182988',
    afrType: '出差报销',
    afrPmony: '12张',
    afrPrice: '￥9999999.00元',
    afrMsg: '分管副总（含高级总监）审批',
    afrName: '张三测试',
    afrTime: '2018-01-01',
    doType: 53,
  },{
    id: 6,
    afrNo: 'NJ20180101182988',
    afrType: '出差报销',
    afrPmony: '12张',
    afrPrice: '￥9999999.00元',
    afrMsg: '分管副总（含高级总监）审批：被退回',
    afrName: '张三测试',
    afrTime: '2018-01-01',
    doType: 54,
  },{
    id: 7,
    afrNo: 'NJ20180101182988',
    afrType: '出差报销',
    afrPmony: '12张',
    afrPrice: '￥9999999.00元',
    afrMsg: '会计',
    afrName: '张三测试',
    afrTime: '2018-01-01',
    doType: 53,
  },{
    id: 8,
    afrNo: 'NJ20180101182988',
    afrType: '出差报销',
    afrPmony: '12张',
    afrPrice: '￥9999999.00元',
    afrMsg: '会计：被退回',
    afrName: '张三测试',
    afrTime: '2018-01-01',
    doType: 54,
  },{
    id: 9,
    afrNo: 'NJ20180101182988',
    afrType: '出差报销',
    afrPmony: '12张',
    afrPrice: '￥9999999.00元',
    afrMsg: '财务领导',
    afrName: '张三测试',
    afrTime: '2018-01-01',
    doType: 53,
  },{
    id: 10,
    afrNo: 'NJ20180101182988',
    afrType: '出差报销',
    afrPmony: '12张',
    afrPrice: '￥9999999.00元',
    afrMsg: '财务领导：被退回',
    afrName: '张三测试',
    afrTime: '2018-01-01',
    doType: 54,
  },{
    id: 11,
    afrNo: 'NJ20180101182988',
    afrType: '出差报销',
    afrPmony: '12张',
    afrPrice: '￥9999999.00元',
    afrMsg: '区总经理核准',
    afrName: '张三测试',
    afrTime: '2018-01-01',
    doType: 53,
  },{
    id: 12,
    afrNo: 'NJ20180101182988',
    afrType: '出差报销',
    afrPmony: '12张',
    afrPrice: '￥9999999.00元',
    afrMsg: '区总经理核准：被退回',
    afrName: '张三测试',
    afrTime: '2018-01-01',
    doType: 54,
  },{
    id: 13,
    afrNo: 'NJ20180101182988',
    afrType: '出差报销',
    afrPmony: '12张',
    afrPrice: '￥9999999.00元',
    afrMsg: '总经理核准',
    afrName: '张三测试',
    afrTime: '2018-01-01',
    doType: 53,
  },{
    id: 14,
    afrNo: 'NJ20180101182988',
    afrType: '出差报销',
    afrPmony: '12张',
    afrPrice: '￥9999999.00元',
    afrMsg: '总经理核准：被退回',
    afrName: '张三测试',
    afrTime: '2018-01-01',
    doType: 54,
  },{
    id: 15,
    afrNo: 'NJ20180101182988',
    afrType: '出差报销',
    afrPmony: '12张',
    afrPrice: '￥9999999.00元',
    afrMsg: '出差报销申请审批完结，打印报销单据操作',
    afrName: '张三测试',
    afrTime: '2018-01-01',
    doType: 55,
  },{
    id: 16,
    afrNo: 'NJ20180101182988',
    afrType: '出差报销',
    afrPmony: '12张',
    afrPrice: '￥9999999.00元',
    afrMsg: '出纳付款',
    afrName: '张三测试',
    afrTime: '2018-01-01',
    doType: 56,
  },{
    id: 17,
    afrNo: 'NJ20180101182988',
    afrType: '出差报销',
    afrPmony: '12张',
    afrPrice: '￥9999999.00元',
    afrMsg: '报销结束',
    afrName: '张三测试',
    afrTime: '2018-01-01',
    doType: 57,
  },],
  columns: afrColumns,
  gridContainer: 'afrContainer',
  toolbarContainer: 'afrToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var afrGrid = $.fn.dlshouwen.grid.init(afrOption);
$(function () {
  afrGrid.load();
});

// 报销流程处理跳转
function toDo(id, doType) {
  if (doType == 53) {
    window.location.href = "../../do/edit/edit-do-53.html" + '?id=' + id + '&doType=' + doType;
  }
  if (doType == 54) {
    window.location.href = "../../do/edit/edit-do-54.html" + '?id=' + id + '&doType=' + doType;
  }
  if (doType == 55) {
    window.location.href = "../../do/edit/edit-do-55.html" + '?id=' + id + '&doType=' + doType;
  }
  if (doType == 56) {
    window.location.href = "../../do/edit/edit-do-56.html" + '?id=' + id + '&doType=' + doType;
  }
  if (doType == 57) {
    window.location.href = "../../do/edit/edit-do-57.html" + '?id=' + id + '&doType=' + doType;
  }
}